public class Demo2 {


    public static void main(String[] args) {
        Circle circle = new Circle();


    }


}


class Dog extends Animal implements Running{

    public Dog(String name, String species) {
        super(name, species);
    }
    @Override
    public void eat() {
        System.out.println(this.name + "正在啃骨头");
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在狂奔");
    }

}

interface Running {
    final static int a = 2;
    void run();

    // 接口可以包含由 default 修饰的普通方法
    default void func() {

    }
}

abstract class Animal {
    protected String name;
    protected String species;

    public Animal(String name, String species) {
        this.name = name;
        this.species = species;
    }
    public void eat() {}

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", species='" + species + '\'' +
                '}';
    }
}




// 抽象类必须被继承，而 final 关键字修饰的类不能被继承
abstract class Shape {
    // 抽象类也是类，也可以增加普通方法和属性
    protected double area; // 面积

    public double getArea(){
        return area;
    }

    // 抽象方法必须被子类重写，而 private 修饰的方法只能在类内使用
    // static 修饰的方法为类方法，子类不能进行重写
    abstract void draw();
    abstract void calcArea();
}

class Circle extends Shape{
    @Override
    public void draw() {}

    @Override
    void calcArea() {}



}